<template>
    <div>
        <h1>食谱添加</h1>
        标题:
        <input type="text" v-model="info.Dname">
        分类:
        <select v-model="info.ftype">
            <option value="">请选择</option>
            <option v-for="item in data" :value="item.tname">{{ item.tname }}</option>
        </select>
        <input type="button" class="btn btn-primary" value="查询" @click="show">
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>菜谱id</td>
                    <td>菜谱标题</td>
                    <td>菜谱图片</td>
                    <td>菜谱标签</td>
                    <td>菜谱分类</td>
                    <td>菜谱发布</td>
                    <td>菜谱详细</td>
                </tr>
                <tr v-for="a in data1">
                    <td>{{ a. fid}}</td>
                    <td>{{ a. ftitle}}</td>
                    <td>
                        <img :src="a.ftp" width="80px" height="80px">
                    </td>
                    <td>{{ a. fbq}}</td>
                    <td>{{ a. ftype}}</td>
                    <td>{{ a. ffb==1?'立即发布':'定时发布'}}  <span v-if="a. ffb=='0'">日期{{ moment(a. fdate).format("YYYY-MM-DD")}}-{{a. ftime  }}</span></td>
                    <td>{{ a. fxx}}</td>
                </tr>
            </tbody>
        </table>

    </div>
</template>

<script setup lang="ts">

import axios from 'axios'
import { ref, reactive, onMounted } from 'vue'
import moment from 'moment'
import 'bootstrap/dist/css/bootstrap.css'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter();
const route = useRoute();

let info: any = reactive({
    "ftitle": "",
    "ftype": "",
    
})

let data: any = ref([])

let data1: any = ref([])


onMounted(() => {
    xlk();
    show();
})

const xlk = () => {
    axios({
        url: '/api/Foot/Showxlk',
        method: 'get',
    })
        .then(res => {
            console.log(res);
            data.value = res.data
        })
}

const show = () => {
  
    axios({
        url: '/api/Doctor/ShowDoctor',
        method: 'get',
        params: info
    })
        .then(res => {
            console.log(res);
            data1.value=res.data
        })
}




</script>

<style scoped></style>